<%-- 
    Document   : produkdetails
    Created on : Jan 8, 2014, 10:26:21 PM
    Author     : lenovo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@page import="java.util.*" %>
<%@page import="model.Produk" %>
<%@page import="model.Koperasi" %>
<%@page import="database.DBClass"%>
<%@page import="validation.ValidateForm"%>
<%@page import ="java.sql.*" %>
<html>
    <%
        Produk produk;
        produk = new Produk();
        produk = (Produk) request.getAttribute("detailproduk");
        String linkkoperasi = (String) request.getAttribute("linkkoperasi");
        DBClass dbobject = new DBClass();
    %>
    <head>
        <style type="text/css">
            body {
                background-color:black;
                background-image:url(images/4.jpg); 
            }
        </style>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap.css" rel="stylesheet"> 
        <link href="<%request.getContextPath();%>/E-Stonion/css/metro-bootstrap-responsive.css" rel="stylesheet">

        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.min.js"></script>
        <script src="<%request.getContextPath();%>/E-Stonion/js/jquery/jquery.widget.min.js"></script>

        <script src="<%request.getContextPath();%>/E-Stonion/js/metro/metro-*.js"></script>
        <title>Produk Detail</title>
    </head>
    <body class="metro">
        <nav class="navigation-bar">
            <nav class="navigation-bar-content">
                <a class="element" href="/E-Stonion/home.jsp">
                    <span class="icon-grid-view"></span>
                    E-Stonion </a>
                <span class="element-divider"></span>
                <a class="element" href="home.jsp">Home</a>
                <a class="element" href="produk.jsp">Produk</a>
                <a class="element" href="koperasi.jsp">Koperasi</a>
                <a class="element" href="aboutus.jsp">About Us</a>
                <span class="element-divider"></span>
                <div class="element input-element place-right">
                    <form method="post" action="<%request.getContextPath();%>/E-Stonion/SearchServlet">
                        <div class="input-control text">
                            <input type="text" name="inputsearch" value="" placeholder="Search...">
                            <button class="btn-search" name="action" value="SearchAll"></button>
                        </div>
                    </form>
                </div>
                <span class="element-divider place-right"></span>
            </nav>
        </nav>


    <center>
        <div class="grid">
            <div class="row bg-white">
                <div class="span3 offset3"><img src="images/produk/<%=produk.getnamaproduk()%>.jpg" class="rounded polaroid"></div>
                <div class="span5 offset1"> <p class="text-left"><%=produk.getnamaproduk()%></p> <br> 
                    <p class="text-left"><%=produk.getdeskripsiproduk()%></p>  <br>
                    <p class="text-left">Jenis Produk : <%=produk.getjenisproduk()%></p> <br>
                    <p class="text-left">Harga: Rp. <%=produk.gethargaproduk()%></p>
                </div>
            </div>
        </div>
    </center>
    <div class="bg-white">
        <p class="text-left">Terdapat di koperasi</p>
        <table width="100%"border="1" class="table table-striped">
            <tr>
                <th>Nama Koperasi</th>
                <th>Alamat Koperasi</th>
                <th>No.telp Koperasi</th>
            </tr>
            <%
                List list = dbobject.getLinkKoperasi(linkkoperasi);
                //                request.setAttribute("list", list);
                //            List list = (List) request.getAttribute("list");
                if (list != null) {
                    for (int i = 0; i < list.size(); i++) {
                        Koperasi ukop = (Koperasi) list.get(i);
            %>
            <tr>
                <td><%=ukop.getnamakoperasi()%></td>
                <td><%=ukop.getalamatkoperasi()%></td>
                <td><%=ukop.getnotelpkoperasi()%></td>
            </tr>
            <%
                    }
                }
            %>
        </table>
    </div>
</body>
</html>